
{% extends "base.html" %}

{% block js %}
<script src="{{ MEDIA_URL }}js/search.js"></script>
<script>
	$(document).ready(function() {
	  search_setcb('professor', function (professor) {
		window.location.href = '/student/student_list/' + professor.pk;
	});
  
{% if not professor %}
  search_show('professor');
{% endif %}
})
</script>
{% endblock %}

{% block title %}
Seznam študentov
{% endblock %}
{% block content %}
<button onclick="search_show('professor')">Išči profesorja</button>
{% if result %}
  {% include "snippets/core/print.htm" %}
	
	<h2>Rezultati poizvedbe</h2>
	<table class="list" style="width: 90%">
	<tr>
		<th class="num">#</th>
		<th>Vpisna številka</th>
		<th>Priimek in ime</th>
		<th>Študijsko leto</th>
		<th>Vrsta vpisa</th>
	</tr>
	{% for student,fake in zippedresult %}
		<tr>
			<td class="num">{{ forloop.counter }}</td>
			<td>{{ student.student.enrollment_number }}</td>
			<td>{{ student.student.user.last_name }} {{ student.student.user.first_name }}</td>
			<td>{{ student.subject.school_year_start }} / {{ student.subject.school_year_end }}</td>
			<td>
			{% if fake != 'V1' %}
			{{ fake }}
			{% endif %}
			</td>
		</tr>
	
	{% endfor %}
	</table>
{% endif %}


<form action="#" method="post">{% csrf_token %}
<h2>Izpis seznama študentov po predmetu, letniku in kombinaciji </h2>
{{ form_subject.as_p }}
<input type="submit" value="Preglej listo študentov po predmetu" name="subject_submit" />
</form>


{% endblock %}